import VueRouter from 'vue-router';

const routes = [
	{ path: '/', redirect: '/welcome'},
	
	{
		path:'/admin',
		component:require('./components/admin/Nav').default,
		children:[
			{path:'/admin',component:require('./components/admin/adminIndex').default},
			{path:'/admin/add',component:require('./components/admin/Add').default},
			{path:'/admin/editdevice/:id',component:require('./components/admin/deviceEdit').default},
			{path:'/admin/adminindex',component:require('./components/admin/adminIndex').default},
			{path:'/admin/admindetail',component:require('./components/admin/deviceEdit').default},

			{path:'/admin/moduleadd',component:require('./components/admin/authAdd').default},

		]
	},

	{
		path:'/sales',
		component:require('./components/sales/Nav').default,
		children:[
			{path:'/sales',component:require('./components/sales/Index').default},
			{path:'/salesItem',component:require('./components/sales/salesItem').default},
			{path:'/sales/addNewSales',component:require('./components/sales/addNewSales').default},
			{path:'/sales/SalesRFQ',component:require('./components/sales/SalesRFQ').default}

			]
	},
	{
		path:'/customer',
		component:require('./components/customer/Nav').default,
		children:[
			{path:'/customer',component:require('./components/customer/Index').default},
			{path:'/customer/detail',component:require('./components/customer/detail').default},
		    {path:'/customer/new',component:require('./components/customer/newCustomer').default},
		    {path:'/customer/vender',component:require('./components/customer/newVender').default},
		    {path:'/customer/rfq',component:require('./components/customer/newRFQ').default},
		    {path:'/customer/BOM',component:require('./components/customer/addBOM').default},

			]
	},

	{
		path:'/vendor',
		component:require('./components/vender/Nav').default,
		children:[
			{path:'/vendor',component:require('./components/vender/Index').default},
			{path:'/venderdetail',component:require('./components/vender/detail').default},

			]
	},
	{
		path:'/part',
		component:require('./components/part/Nav').default,
		children:[
			{path:'/part',component:require('./components/part/Index').default},
			{path:'/partdetail',component:require('./components/part/detail').default},
			{path:'/partadd',component:require('./components/part/addPart').default},
			{path:'/purchordersearch',component:require('./components/part/purchOrderSearch').default},
			{path:'/saleordersearch',component:require('./components/part/SaleOrderSearch').default},

			{path:'/brand',component:require('./components/brand/Index').default},
			{path:'/branddetail',component:require('./components/brand/detail').default},
			{path:'/brandadd',component:require('./components/brand/addBrand').default},
			]
	},
	//purchase
	{
		path:'/purchase',
		component:require('./components/purchase/Nav').default,
		children:[
			{path:'/customer/detail',component:require('./components/customer/detail').default},
			{path:'/purchase',component:require('./components/purchase/rfqIndex').default},
			{path:'/purchaseRequest',component:require('./components/purchase/purchaseRequest').default},
			{path:'/purchaseOrder',component:require('./components/purchase/purchaseOrder').default},

			]
	},

	{
		path:'/welcome',
		component:require('./components/index/welcome').default,

	},

	{
		path:'/base',
		component:require('./components/base/Nav').default,
		children:[
			{path:'/base',component:require('./components/base/Index').default},
			{path:'/import',component:require('./components/base/Import').default},
			{path:'/base-detail',component:require('./components/base/base-detail').default},
			]
	},
		
];

const router = new VueRouter({
	routes
});

export default router;